###################################################################
#  Tests von directionDetection                                   #
#  Autor : Medawar                                                #
#  Clock periode : 10Khz                                          # 
###################################################################

restart -f
### Clock 10 Khz
force -freeze sim:/directiondetector/clockinput 1 0, 0 {0.05ms} -r 0.1ms
force -freeze sim:/directiondetector/wheelinputa 0 0
force -freeze sim:/directiondetector/wheelinputb 0 0
run 8ms



#### Wir generieren wieder 2 bewegung von rad in positive richtung
set x 0
while {$x<2} {
  force -freeze sim:/directiondetector/wheelinputa 1 0
  run 1ms
  force -freeze sim:/directiondetector/wheelinputb 1 0
  run 4ms
  force -freeze sim:/directiondetector/wheelinputa 0 0
  run 1ms
  force -freeze sim:/directiondetector/wheelinputb 0 0
  run 4ms
  incr x
}
#### Wir generieren 3 bewegung von rad in negative richtung
set x 0
while {$x<3} {
    force -freeze sim:/directiondetector/wheelinputb 1 0
  run 1ms
  force -freeze sim:/directiondetector/wheelinputa 1 0
  run 4ms
  force -freeze sim:/directiondetector/wheelinputb 0 0
  run 1ms
  force -freeze sim:/directiondetector/wheelinputa 0 0
  run 4ms
  incr x
}
#### Wir generieren wieder 1 bewegung von rad in positive richtung
set x 0
while {$x<1} {
  force -freeze sim:/directiondetector/wheelinputa 1 0
  run 1ms
  force -freeze sim:/directiondetector/wheelinputb 1 0
  run 4ms
  force -freeze sim:/directiondetector/wheelinputa 0 0
  run 1ms
  force -freeze sim:/directiondetector/wheelinputb 0 0
  run 4ms
  incr x
}
#### Wir generieren 2 bewegung von rad in negative richtung
set x 0
while {$x<2} {
    force -freeze sim:/directiondetector/wheelinputb 1 0
  run 1ms
  force -freeze sim:/directiondetector/wheelinputa 1 0
  run 4ms
  force -freeze sim:/directiondetector/wheelinputb 0 0
  run 1ms
  force -freeze sim:/directiondetector/wheelinputa 0 0
  run 4ms
  incr x
}